package com.senlingspace.system.mapper;

import java.util.List;

import com.senlingspace.system.domain.SlkjFareSchemeDetail;
import org.apache.ibatis.annotations.Param;

/**
 * 票价方案详情Mapper接口
 *
 * @author SenlingSpace
 * @date 2024-07-15
 */
public interface SlkjFareSchemeDetailMapper {
    /**
     * 查询票价方案详情
     *
     * @param id 票价方案详情主键
     * @return 票价方案详情
     */
    public SlkjFareSchemeDetail selectSlkjFareSchemeDetailById(Long id);

    /**
     * 查询票价方案详情列表
     *
     * @param slkjFareSchemeDetail 票价方案详情
     * @return 票价方案详情集合
     */
    public List<SlkjFareSchemeDetail> selectSlkjFareSchemeDetailList(SlkjFareSchemeDetail slkjFareSchemeDetail);

    /**
     * 新增票价方案详情
     *
     * @param slkjFareSchemeDetail 票价方案详情
     * @return 结果
     */
    public int insertSlkjFareSchemeDetail(SlkjFareSchemeDetail slkjFareSchemeDetail);

    /**
     * 修改票价方案详情
     *
     * @param slkjFareSchemeDetail 票价方案详情
     * @return 结果
     */
    public int updateSlkjFareSchemeDetail(SlkjFareSchemeDetail slkjFareSchemeDetail);

    /**
     * 删除票价方案详情
     *
     * @param id 票价方案详情主键
     * @return 结果
     */
    public int deleteSlkjFareSchemeDetailById(Long id);

    /**
     * 批量删除票价方案详情
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteSlkjFareSchemeDetailByIds(Long[] ids);

    /**
     * 根据票价方案ids查询票价方案详情
     *
     * @param ids
     * @return {@link List }<{@link SlkjFareSchemeDetail }>
     */
    List<SlkjFareSchemeDetail> selectSlkjFareSchemeDetailByFareSchemeIds(@Param("ids") List<Long> ids);

    /**
     * 批量新增票价方案详情
     *
     * @param fareSchemeDetails
     * @return int
     */
    int batchInsertSlkjFareSchemeDetail(@Param("fareSchemeDetails") List<SlkjFareSchemeDetail> fareSchemeDetails);

    /**
     * 根据票类 ID 集合查询
     *
     * @param ids
     * @return {@link List }<{@link SlkjFareSchemeDetail }>
     */
    List<SlkjFareSchemeDetail> selectSlkjFareSchemeDetailByTicketCategoryIds(Long[] ids);

    /**
     * 逻辑删除
     *
     * @param ids
     */
    long updateSlkjFareSchemeDetailByFareSchemeIds(Long[] ids);

    /**
     * 批量更新
     *
     * @param fareSchemeDetails
     * @return int
     */
    int batchUpdateSlkjFareSchemeDetail(@Param("details") List<SlkjFareSchemeDetail> fareSchemeDetails);

    /**
     * 根据票价方案 ID + 票价方案详情 ID 集合，更新状态
     *
     * @param detailIds
     * @param fareSchemeId
     * @param status
     * @return int
     */
    int updateSlkjFareSchemeDetailStatus(@Param("detailIds") List<Long> detailIds, @Param("fareSchemeId") Long fareSchemeId, @Param("status") Byte status);

    /**
     * 根据票价方案明细ids查询票价方案详情
     *
     * @param ids
     * @return {@link List }<{@link SlkjFareSchemeDetail }>
     */
    List<SlkjFareSchemeDetail> selectSlkjFareSchemeDetailByIds(@Param("ids") List<Long> ids);

    /**
     * 根据票价方案 ID + 票价方案详情 ID 集合 重置对应价格
     *
     * @param detailIds
     * @param fareSchemeId
     */
    int resetDataToNull(@Param("detailIds") List<Long> detailIds, @Param("fareSchemeId") Long fareSchemeId);

    /**
     * 根据票档 ID 统计
     *
     * @param ticketLevelId
     * @return long
     */
    long countByTicketLevelId(@Param("ticketLevelId") Long ticketLevelId);

    /**
     * 根据票档 ID 更新状态至删除
     *
     * @param ticketLevelId
     * @return long
     */
    long updateSlkjFareSchemeDetailStatusByTicketLevelId(@Param("ticketLevelId") Long ticketLevelId);

    /**
     * 根据票类ID+票档Id 更新状态至删除
     *
     * @param ticketCategoryId
     * @param ticketLevelId
     * @return int
     */
    int updateSlkjFareSchemeDetailStatusByCategoryId(@Param("ticketCategoryId") Long ticketCategoryId, @Param("ticketLevelId") Long ticketLevelId);

}
